#include <graphics.h>
using namespace std;
double const eps = 1e-9;
double K = 0;
double const epsilon = 1e-5;

double abs(double arg)
{
       
       if(arg > 0)
       {
              return arg;
       }
       else
       {
              return arg*(-1);
       }
}

double** illConditionedMatrixGenerator_A(int n, int N, double epsilon)
{
	double **result = new double *[n];
	for (int i = 0; i < n; i++)
	{
		result[i] = new double[n];

		result[i][i] = 1+epsilon*N;
		for (int j = i+1; j < n; j++)
		{
			result[i][j] = -1 - epsilon*N;
		}
		for (int j = 0; j < i; j++)
		{
			result[i][j] = epsilon*N;
		}
	}

	return result;
}

double matrixnorm_1(double **a, int rows, int columnes)
{
	double result = 0;
	double tmp = 0;
	for (int i = 0; i < columnes; i++)
	{
		for (int j = 0; j < rows; j++)
		{
			tmp += abs(a[j][i]);
		}
		if (tmp > result)
		{
			result = tmp;
			tmp = 0;
		}
		else
		{
			tmp = 0;
		}
	}

	return result;
}

int main ()
{
    
    initwindow(400,300);
    moveto(0,0);
    lineto(50,50);
    getch();
    closegraph();
    return 0;
    
}
